<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>节点操作</title>
    <script type="text/javascript" src="jquery-3.7.1.js"></script>
</head>
<body>

<script>
    $(function () {
        $("p").html("<h1>这是JQuery新插入的标题</h1>");
        console.log($("p").html());
        console.log($("p").text());
        console.log($("#bj").val());
        $("#bj").val("capital");
        console.log($("#bj").val());
        alert($("#bj").text());
        $("#bj").text("首都");
        console.log($("#bj").text());
        $("#s1").change(function(){
            var value = $("#s1").val();
            alert(value);
        })

    })
</script>

<p>这是一个段落</p>
<select id="s1">
    <option id="bj" value="beijing">北京</option>
    <option value="shanghai">上海</option>
    <option value="hangzhou">杭州</option>
    <option value="shenzhen">深圳</option>
</select>
</body>
</html>